package com.luanye.enjoy.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luanye.enjoy.entity.TribeUser;
import com.luanye.enjoy.mapper.TribeUserMapper;
import com.luanye.enjoy.service.TribeUserService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("tribeUserService")
@AllArgsConstructor
public class TribeUserServiceImpl extends ServiceImpl<TribeUserMapper, TribeUser> implements TribeUserService {


    private final TribeUserMapper tribeUserMapper;

    @Override
    public List<TribeUser> getNumByTribeId(Integer tribeId) {
        LambdaQueryWrapper<TribeUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TribeUser::getTribeId,tribeId);
        Page<TribeUser> page = new Page<>(1,7);

        page(page,queryWrapper);
        List<TribeUser> records = page.getRecords();

        return records;
    }
}
